package com.xzm.project.ui.activity

import android.os.Bundle
import android.os.Handler
import android.os.Message
import android.util.SparseArray
import androidx.lifecycle.Transformations.map
import cn.wuyu.baselibrary.base.TestBaseActivity
import java.lang.ref.WeakReference

class TestHandlerAct : BaseActivity() {

    private var mHandler: Handler? = WithoutLeakHandler(this)

    override fun getLayoutID(): Int {
        return 0
    }

    companion object {
        const val CODE_LOAD_DATA: Int   = 101
        private class WithoutLeakHandler(activity: TestHandlerAct) :Handler(){
            private var mActivity: WeakReference<TestHandlerAct> = WeakReference(activity)
            override fun handleMessage(msg: Message?) {
                super.handleMessage(msg)
                val act = mActivity.get()
                when (msg?.what) {
                    CODE_LOAD_DATA -> {
                    }
                    else -> {
                    }
                }
            }
        }
    }

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        mHandler?.sendEmptyMessage(CODE_LOAD_DATA)
    }


//   private infix data class
//
//    private var xx:String=   map(
//            1 to "one",
//            2 to "two",
//            3 to "three"
//    )
   private fun test(){

        val   list = mutableListOf<String>()
        list.apply {

        }
        list.let {

        }
        list.let {

        }
    }

}

